/** 产品管理 */
import httpRequest from '@/utils/httpRequest'
// 根据id获取销售价格策略
export function getById (data) {
  return httpRequest({
    url: '/basis/product/productPrice',
    method: 'get',
    params: data
  })
}
// 产品目录加载接口
export function getTreeData (data) {
  return httpRequest({
    url: '/basis/product/productCategory/treeData',
    method: 'get',
    params: data
  })
}
// 销售价格策略列表
export function getList (data) {
  return httpRequest({
    url: '/basis/product/productPrice/list',
    method: 'get',
    params: data
  })
}
// 检测销售价格策略时间重叠
export function isRepeat (data) {
  return httpRequest({
    url: '/basis/product/productPrice/isRepeat',
    method: 'get',
    params: data
  })
}
// 新增or修改销售价格策略
export function edit (data) {
  return httpRequest({
    url: '/basis/product/productPrice',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 根据ID修改状态
export function editState (data) {
  return httpRequest({
    url: '/basis/product/productPrice/updateStatus',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 删除产品
export function delPrice (data) {
  return httpRequest({
    url: '/basis/product/productPrice/delete',
    method: 'post',
    data: data
  })
}
